'use strict'
const path = require('path')
// const defaultSettings = require('./src/settings.js')

function resolve(dir) {
  return path.join(__dirname, dir)
}

const name = '默认title'
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
const port = 9527 // dev port

module.exports = {
  devServer: {
    open: true,
    port: 8080,
    https:false,
    proxy: {
      '/api': {
        // target: 'http://pdm.ideal.com/Windchill/servlet/WindchillAuthGW/api/', //API服务器的地址
        target: process.env.VUE_APP_TARGET, //API服务器的地址
        ws: true,  //代理websockets
        changeOrigin: true, // 虚拟的站点需要更管origin
        pathRewrite: {   //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
          '^/api': ''
        }
      }
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        cmp: "@/components"
      }
    }
  },
  publicPath:'',
  // chainWebpack:(config)=>{
  //     config.entry('main').add('babel-polyfill')
  // },
  // transpileDependencies:[
  //     'biyi-admin'
  // ]
}
